package mr

//
// RPC definitions.
//
// remember to capitalize all names.
//

import (
	"os"
)
import "strconv"

type ExampleArgs struct {
	X int
}

type ExampleReply struct {
	Y int
}

// Add your RPC definitions here.

type GetTaskArgs struct {
	WorkerId int
}

type GetTaskReply struct {
	Stage     int
	InputFile string
	NReduce   int
}

type FinishTaskArgs struct {
	WorkerId  int
	InputFile string
}

type FinishTaskReply struct {
	Ok bool
}

type CommitTaskArgs struct {
	InputFile string
}

type CommitTaskReply struct {
	Ok bool
}

// Cook up a unique-ish UNIX-domain socket name
// in /var/tmp, for the coordinator.
// Can't use the current directory since
// Athena AFS doesn't support UNIX-domain sockets.
func coordinatorSock() string {
	s := "/var/tmp/824-mr-"
	s += strconv.Itoa(os.Getuid())
	return s
}
